$(function(){
//	$("#telWrong").css("display","none");
	$("#passWrong").css("display","none");
	$("#passAgainWrong").css("display","none");
	$("#emailWrong").css("display","none")
//	var reg1 = /^1[3-9][0-9]{9}$/;
//	$("#telphone").blur(function(){
//		var tel = $("#telphone").val(); 
//		var telTrue = reg1.test(tel);
//		if(telTrue==false){
//			$("#telWrong").css("display","block");
//		}
//		else{
//			$("#telWrong").css("display","none");
//		}
//	})
				
	var reg2 = /^[a-zA-Z][a-zA-Z0-9_]{7,15}$/;
	$("#password").blur(function(){
		var pass = $("#password").val();
		console.log(pass);
		var passTrue = reg2.test(pass);
		console.log(passTrue);
		if(passTrue==true){
			$("#passWrong").css("display","none");
		}
		else{
			$("#passWrong").css("display","block");
		}
	})
	
	$("#passwordAgain").blur(function(){
		var pass = $("#password").val();
		var passAgain = $("#passwordAgain").val();
		var passAgainTrue =( pass.length != 0 && pass == passAgain);
	    console.log(passAgainTrue);
		if(passAgainTrue == false) {
			$("#passAgainWrong").css("display","block");
		} 
		else {
			$("#passAgainWrong").css("display","none");
		}
	})
	
	var reg3 =/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	$("#email").blur(function(){
		var ema = $("#email").val();
		var emaTrue = reg3.test(ema);
		if(emaTrue == false) {
			$("#emailWrong").css("display","block");
		} else {
			$("#emailWrong").css("display","none");
		}
	})
	
	$("#signIn").focus(function(){
		var tel = $("#telphone").val(); 
		var pass = $("#password").val();
		var passAgain = $("#passwordAgain").val();
		var ema = $("#email").val();
		if(telTrue==flase||passTrue==false||passAgainTrue==false||emaTrue==false){
			$("#signIn").submit(function(event){
		    	event.preventDefault();
		    });
	   }
		
	})
})


